package com.lagou.dao;

import com.lagou.pojo.Novel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface NovelDao {

    /**
     * 添加
     * */
    @Insert("insert into novel(id,title,author,pic,content) values(#{id},#{title},#{author},#{pic},#{content})")
    @Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
    int insertNovel(Novel novel);

    /**
     * 查询
     * */
    @Select({"select * from novel where id = #{id}"})
    Novel findNovelById(@Param("id") Long id);


}
